package com.qeado.site.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.qeado.site.dao.FilterWordManagerDao;
import com.qeado.site.model.FilterWord;
import com.qeado.site.service.FilterWordManageService;

@Service
public class FilterWordManageServiceImpl implements FilterWordManageService {

	@Autowired
	private FilterWordManagerDao filterWordManageDao;
	
	public List<FilterWord> getFilterWordByWord(FilterWord fiterWord) {
		
		return this.filterWordManageDao.getFilterWordByWord(fiterWord);
		
	}

	public String insertNewFilterWord(FilterWord fiterWord) {
		if(filterWordManageDao.searchFilterWordByWord(fiterWord) != null)
			return "该过滤词已存在！";
		this.filterWordManageDao.insertNewFilterWord(fiterWord);
		return null;
		
	}

	public void deleteFilterWordByWord(FilterWord fiterWord) {
		this.filterWordManageDao.deleteFilterWordByWord(fiterWord);
		
	}


}
